#include "stdafx.h"
#include "TextureCube.h"
#include <assert.h>

TextureCube::TextureCube(ID3D11Texture2D* texture, ID3D11ShaderResourceView* srv)
{
	this->texture = texture;
	this->srv = srv;
}

/*virtual*/ TextureCube::~TextureCube(void)
{
	if (texture)
		texture->Release();
	if (srv)
		srv->Release();
}

/*virtual*/ void TextureCube::getData(void* data, unsigned int pixelStride) /*override*/
{
	data = &texture;
}

/*virtual*/ void TextureCube::setData(void* data, unsigned int pixelStride) /*override*/
{
	texture = *(ID3D11Texture2D**)data;
}

/*virtual*/ void TextureCube::getDesc(void* desc) /*override*/
{
	texture->GetDesc((D3D11_TEXTURE2D_DESC*)desc);
}